#import "dfhgwhruebvhrheyoutputemit.h"
@implementation dfhgwhruebvhrheyoutputemit {
	UIButton *closeBtn;
	UILabel *authTitleText;
	UIImageView *authIcon;
	UILabel *tipsText;
	UIButton *clickBtn;
	void(^_callback)(BOOL isCancel);
}
- (instancetype)initWithFrame:(CGRect)frame {
	if(self = [super initWithFrame:frame]) {
		[self setUI];
	}
	return self;
}
- (void)setUI {
	self.layer.cornerRadius = 20;
	self.backgroundColor = primary_color.dhgfywegwygeydwlearneddesignate;
	closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
	closeBtn.tag = 100;
	[closeBtn setImage:[UIImage imageNamed:@"home_identity_pop_close"] forState:UIControlStateNormal];
	[self addSubview:closeBtn];
	[closeBtn addTarget:self action:@selector(clickBtnAction:) forControlEvents:UIControlEventTouchUpInside];
	authTitleText = [[UILabel alloc] init];
	authTitleText.font = [UIFont medium:20];
	authTitleText.text = @"Identity Authentication";
	authTitleText.textColor = [UIColor whiteColor];
	authTitleText.textAlignment = NSTextAlignmentCenter;
	[self addSubview:authTitleText];
	authIcon = [[UIImageView alloc] init];
	authIcon.image = [UIImage imageNamed:@"home_identity_pop_id"];
	[self addSubview:authIcon];
	tipsText = [[UILabel alloc] init];
	tipsText.font = [UIFont medium:15];
	tipsText.textColor = [UIColor whiteColor];
	tipsText.text = @"Click to upload the front photo of ID card";
	tipsText.textAlignment = NSTextAlignmentCenter;
	[self addSubview:tipsText];
	clickBtn = [UIButton buttonWithType:UIButtonTypeCustom];
	clickBtn.tag = 200;
	clickBtn.layer.cornerRadius = 10;
	clickBtn.titleLabel.font = [UIFont semiBold:18];
	clickBtn.backgroundColor = second_color.dhgfywegwygeydwlearneddesignate;
	[clickBtn setTitle:@"Click upload" forState:UIControlStateNormal];
	[clickBtn setTitleColor:primary_color.dhgfywegwygeydwlearneddesignate forState:UIControlStateNormal];
	[clickBtn addTarget:self action:@selector(clickBtnAction:) forControlEvents:UIControlEventTouchUpInside];
	[self addSubview:clickBtn];
}
- (void)setIdentityCallBack:(void (^)(BOOL))callback {
	_callback = callback;
}
- (void)clickBtnAction:(UIButton *)sender {
	if(_callback) {
		_callback(sender.tag == 100);
	}
}
- (void)layoutSubviews {
	[super layoutSubviews];
	[closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.equalTo(self).offset(20);
		make.right.equalTo(self).offset(-20);
		make.size.mas_equalTo(CGSizeMake(20, 20));
	}];
	[authTitleText mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.equalTo(closeBtn.mas_bottom).offset(10);
		make.centerX.equalTo(self);
		make.height.mas_equalTo(20);
	}];
	[authIcon mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.equalTo(authTitleText.mas_bottom).offset(30);
		make.centerX.equalTo(self);
		make.size.mas_equalTo(CGSizeMake(260, 170));
	}];
	[tipsText mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.equalTo(authIcon.mas_bottom).offset(20);
		make.height.mas_equalTo(21);
		make.centerX.equalTo(self);
	}];
	[clickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.equalTo(tipsText.mas_bottom).offset(40);
		make.centerX.equalTo(self);
		make.size.mas_equalTo(CGSizeMake(200, 50));
	}];
}
@end
